#!/bin/bash
# Zaitan Module - jSMS Install
# Zaitan Team <http://code.google.com/p/zaitan/>

RMOD_ENGINE='3.0'
RMOD_CATEGORY='Software'
RMOD_SUBCATEGORY='IM'
RMOD_NAME='jSMS'
RMOD_AUTHOR='Zaitan Team'
RMOD_VERSION='2.53'
RMOD_DESCRIPTION='Installs jSMS 2.53'


# Install jSMS


echo Running $RMOD_NAME...
#/usr/lib/zaitan/modulo/mod-checkInstall


cd /usr/share/zaitan
wget -c http://jsms.com.br/download/jSMS-253.jar


mkdir JSMS
mkdir JSMS/DEBIAN
mkdir JSMS/usr
mkdir JSMS/usr/bin
mkdir JSMS/usr/lib
mkdir JSMS/usr/lib/jsms
mkdir JSMS/usr/share
mkdir JSMS/usr/share/applications

mv jSMS-253.jar JSMS/usr/lib/jsms/

echo "Package: jsms
Version: 2.53
Section: unknown
Priority: optional
Architecture: all
Depends: sun-java6-jre
Installed-Size: 700
Maintainer: JsMs <www.jsms.com.br> e José Nilton Criador do Pacote DEB
Description: Envia mensagens para celular
 DeVeDe is a program to create video DVDs and CDs (VCD, sVCD or CVD),
 suitables for home players, from any number of video files, in any of
 the formats supported by Mplayer.
 .
 http://www.jsms.com.br" > JSMS/DEBIAN/control


echo "#!/bin/bash
java -jar /usr/lib/jsms/jSMS-253.jar" > JSMS/usr/bin/jsms
sleep 2
chmod +x JSMS/usr/bin/jsms

echo "[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=jSMS-2.53
Type=Application
Terminal=false
Icon[pt_BR]=/usr/share/pixmaps/jsms.xpm
Name[pt_BR]=jsms
Exec=jsms
Icon=/usr/share/pixmaps/jsms.xpm 
Categories=Application;Network;" > JSMS/usr/share/applications/jsms.desktop


dpkg-deb -b JSMS/ jsms-2.53.deb

rm -rf JSMS

dpkg -i jsms-2.53.deb
apt-get -f install

sleep 2
echo $RMOD_NAME Finished...

##Logs
echo $RMOD_NAME-$RMOD_VERSION | tee -a /usr/share/zaitan/logs
/usr/lib/zaitan/modulo/mod-logs
##

exit 0
